<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>修改密码</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no,email=no,address=no"/>
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <link rel="stylesheet" href="../css/zy_common.css"/>
    <link rel="stylesheet" href="../css/zy_base.css"/>
</head>
<body>
    <div class="pswBox bw">
        <p class="plr24 bdb"><span class="col3 font15">原密码：</span><input type="password" placeholder="请输入原密码" class="h100 font15 col9 ml40" id="psw"></p>
        <p class="plr24 bdb"><span class="col3 font15">新密码：</span><input type="password" placeholder="请输入新密码" class="h100 font15 col9 ml40"  id="n_psw"></p>
        <p class="plr24 bdb"><span class="col3 font15">再次输入新密码：</span><input type="password" placeholder="请再次输入新密码" class="h100 font15 col9 ml40" id="nn_psw"></p>
    </div>
    <div class="confirm" style="margin-top: .9rem;">立即修改</div>
</body>
</html>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script type="text/javascript" src="../js/dlc.js"></script>
<script>
    var onOff=0;
    $(function () {
        $('.confirm').click(function () {
            var psw = $('#psw').val();
            var n_psw = $('#n_psw').val();
            var nn_psw = $('#nn_psw').val();
            if(isNull(psw)){
                dlctipbox.show('请输入原密码');
            }else if(isNull(n_psw)){
                dlctipbox.show('请输入新密码');
            }else if(isNull(nn_psw)){
                dlctipbox.show('请再次输入新密码');
            }else if(nn_psw != n_psw){
                dlctipbox.show('两次输入的密码不一致！');
            }else{
                onOff = 1;
                dlc_request('/api/agent/updatePwd',{'password':psw,'newPassword':n_psw,'rePassword':nn_psw},function(res){
                    console.log(res);
                    if(res.code == 1){
                        dlctipbox.alert('修改成功',function (flag) {
                            if(flag==1){
                                exitApp();
                            }
                        })
                    }else{
                        onOff = 0;
                        dlctipbox.show(res.msg);
                    }
                });
            }
        });
    })
</script>
